docs.rs failed to build libp2p-quic-0.10.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
libp2p-quic-0.11.1
Implementation of the QUIC transport protocol for libp2p.
# Usage
Example:
```
# #[cfg(not(feature = "async-std"))]
# fn main() {}
#
# #[cfg(feature = "async-std")]
# fn main() -> std::io::Result<()> {
#
use libp2p_quic as quic;
use libp2p_core::{Multiaddr, Transport, transport::ListenerId};
let keypair = libp2p_identity::Keypair::generate_ed25519();
let quic_config = quic::Config::new(&keypair);
let mut quic_transport = quic::async_std::Transport::new(quic_config);
let addr = "/ip4/127.0.0.1/udp/12345/quic-v1".parse().expect("address should be valid");
quic_transport.listen_on(ListenerId::next(), addr).expect("listen error.");
#
# Ok(())
# }
```
The [`GenTransport`] struct implements the [`libp2p_core::Transport`]. See the
documentation of [`libp2p_core`] and of libp2p in general to learn how to use the
[`Transport`][libp2p_core::Transport] trait.
Note that QUIC provides transport, security, and multiplexing in a single protocol. Therefore,
QUIC connections do not need to be upgraded. You will get a compile-time error if you try.
Instead, you must pass all needed configuration into the constructor.